const app = getApp();
Page({
  onLoad: function (options) {
    this.equipment_number = options.equipment_number;
    this.isRepair = options.is_repair == 1 ? true : false;
    this.getEquipment();
  },

  getEquipment() {
    let url = "Partner/Equipment/getEquipmentStatus";
    if (this.isRepair) {
      url = "Manage/Equipment/getEquipmentStatus";
    }
    app.ajax({
      url,
      data: {
        equipment_number: this.equipment_number
      },
      success: (res) => {
        if (res.data.code == 1000) {
          var eqDetail = res.data.data;
          this.setData({
            ...eqDetail
          })
        } else {
          app.showToast(res.data.msg);
        }
      }
    })
  }
})